import http from '@/api/request.js';

// 获取个人信息
export function getUserInfo(params = {}) {
  return http({
    url: '/sys/user/getMiniUserInfo',
    method: 'get',
    params: params
  });
}

// 修改个人信息
export function updateUserInfo(params = {}) {
  return http({
    url: '/sys/user/updateUserInfo',
    method: 'get',
    params: params
  });
}

// 修改手机号
export function updateUserPhone(params = {}) {
  return http({
    url: '/sys/user/updateUserPhone',
    method: 'get',
    params: params
  });
}

// 修改密码
export function updatePassword(params = {}) {
  return http({
    url: '/mobile/updatePassword',
    method: 'get',
    params: params
  });
}


// 收藏列表
export function getCollectList(params = {}) {
  return http({
    url: '/dz/dzFavorite/pageMyDzFavoriteList',
    method: 'get',
    params: params
  });
}

// 批量取消收藏
export function removeCollectBatch(params = {}) {
  return http({
    url: '/dz/dzFavorite/deleteBatch',
    method: 'get',
    params: params
  });
}

// 清单列表
export function getCartList(params = {}) {
  return http({
    url: '/dz/dzMaterialSkuCart/pageMyCartList',
    method: 'get',
    params: params
  });
}

// 批量移除清单
export function removeCartBatch(params = {}) {
  return http({
    url: '/dz/dzMaterialSkuCart/deleteBatch',
    method: 'get',
    params: params
  });
}

// 提交购物车
export function submitCart(params = {}) {
  return http({
    url: '/dz/dzMaterialCart/submitCart',
    method: 'post',
    params: params
  });
}

// 订单列表
export function orderList(params = {}) {
  return http({
    url: '/dz/dzMaterialCart/pageMyOrderList',
    method: 'get',
    params: params
  });
}

// 订单详情
export function orderDetail(params = {}) {
  return http({
    url: '/dz/dzMaterialCart/queryById',
    method: 'get',
    params: params
  });
}
// 订单详情
export function orderGoodsDetail(params = {}) {
  return http({
    url: '/dz/dzMaterialCart/queryDzMaterialSkuCartByMainId',
    method: 'get',
    params: params
  });
}

// 公司简介
export function getCompanyInfo(params = {}) {
  return http({
    url: '/dz/dzSupplier/queryCompanyInfo',
    method: 'get',
    params: params
  });
}

// 公司简介
export function changePassword(params = {}) {
  return http({
    url: '/sys/user/changeMiniPassword',
    method: 'post',
    params: params
  });
}
